﻿Function Get-EventGroupFilterCondition
{
  [CmdletBinding(DefaultParameterSetName="Number")]
  param
  (
    [parameter(Position=0,
               Mandatory=$True,
               ParameterSetName="Number")]
    [int]
    $Number = -1,

    [parameter(Position=0,
               Mandatory=$True,
               ParameterSetName="FriendlyName")]
    [String]
    $FriendlyName,

    [parameter(Position=0,
               Mandatory=$True,
               ParameterSetName="Order")]
    [int]
    $Order = -1,

    [parameter(Position=0,
               Mandatory=$True,
               ParameterSetName="Id")]
    [System.Guid]
    $Id
  )

  Begin
  {
  }

  Process
  {
    # Find the event group.
    if ($Number -ge 0)
    {
      $Group = Get-EventGroup -Number $Number
    }
    elseif ($FriendlyName.Length -gt 0)
    {
      $Group = Get-EventGroup -FriendlyName $FriendlyName
    }
    elseif ($Id -ne $Null)
    {
      $Group = Get-EventGroup -Id $Id
    }
    elseif ($Order -ge 0)
    {
      $Group = Get-EventGroup -Order $Order
    }

    return $Group.FilterConditions
  }

  End
  {
  }
}